#include "converter.h"

int main( int argc, char *argv[] )
{
	if ( argc != 3 )
	{
		printf( "speckle usage: speckle <img full name> <txt full name>\n" );
		return 1;
	}

	// init gdi+
	GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR gdiplusToken;
	GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, NULL );

	// convert names of files from ACP codepage
	wchar_t img_name[1024], txt_name[1024];
	MultiByteToWideChar( CP_ACP, 0, argv[1], -1, img_name, 1024 );
	MultiByteToWideChar( CP_ACP, 0, argv[2], -1, txt_name, 1024 );

	// create txt file from image file
	convert( img_name, txt_name );
	
	// close gdi+
	GdiplusShutdown( gdiplusToken );
	return 0;
}